package com.hxwm.entity;

import java.util.ArrayList;
import java.util.List;

public class MapperTable {
    private String tableName;//表名
    private List<MapperField> tableFields;//行

    public MapperTable(String tableName) {
        this.tableName = tableName;
        this.tableFields = new ArrayList<>();
    }

    @Override
    public String toString(){
        String fieldNames="";
        if(tableFields!=null) {
            for (MapperField tabFields : tableFields) {
                if(tabFields.getFieldName()!=null && !"".equals(tabFields.getFieldName())) {
                    fieldNames = fieldNames + tabFields.getFieldName() + ",";
                }
            }
            fieldNames = fieldNames.substring(0, fieldNames.lastIndexOf(","));
        }
        return fieldNames;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    public List<MapperField> getTableFields() {
        return tableFields;
    }

    public void setTableFields(List<MapperField> tableFields) {
        this.tableFields = tableFields;
    }
}
